<template>
  <div class="recognition-box" :style="{borderColor:color}">
    <div class="recognition-title" :style="{background:color}">{{titleName}}</div>
    <div class="recognition-content">
      <span v-for="(item,index) in listData" :key="index">
        <i class="suncnui suncnui-icon-sj" :style="{color:color}"></i>
        {{item.name}}
      </span>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    titleName: {
      type: String,
      default: "",
    },
    listData: {
      type: Array,
      default: () => [],
    },
    color: {
      type: String,
      default: "#ffb12a",
    },
  },
};
</script>

<style lang="stylus" scoped>
.recognition-box {
  width: 100%;
  border: 1px solid #333;
  padding: 40px 5px 25px 40px;
  box-sizing: border-box;
  background: #fff;
  position: relative;
  font-size: 16px;
  color: #333;
  line-height: 2;
  margin-top: 40px;

  .recognition-title {
    position: absolute;
    top: -17px;
    left: 35px;
    width: 80px;
    height: 35px;
    line-height: 35px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    background: #ffb12a;
    border-radius: 5px;
  }

  .recognition-content {
    span {
      margin-right: 30px;
      white-space: nowrap; /* 强制span不换行 */
      display: inline-block;
    }

    i {
      color: #ffb12a;
    }
  }
}
</style>